﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.Collections.Generic.List<CRM.Database.Model.BonusStatuses>>" %>

<%@ Import Namespace="CRM.Resourses" %>


<% Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdBonusStatuses";
                                        settings.KeyFieldName = "IdBonusStatuses";
                                        settings.CallbackRouteValues = new { Controller = "Contracts", Action = "BonusesStatusesPartial" };
                                        settings.SettingsPager.PageSize = 20;

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.NameEn;
                                            column.FieldName = "NameEn";
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.NameRu;
                                            column.FieldName = "NameRu";
                                        });

                                       
                                        
                                        settings.CommandColumn.Visible = true;
                                        settings.CommandColumn.NewButton.Visible = true;
                                        settings.CommandColumn.DeleteButton.Visible = true;
                                        settings.CommandColumn.EditButton.Visible = true;
                                        settings.SettingsBehavior.ConfirmDelete = true;
                                        settings.Settings.ShowFilterRow = true;
                                        settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Contracts", Action = "BonusesStatusesPartialUpdate" };
                                        settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Contracts", Action = "BonusesStatusesPartialAdd" };
                                        settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Contracts", Action = "CreditTypesPartialDelete" };
                                        settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
                                        settings.Width = Unit.Percentage(100);
                                    })
       .Bind(Model).GetHtml();
%>